#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int n = 0;
    cin >> n;
    vector<int>arr(n * 3, 0);
    for (int i = 0; i < n * 3; i++)
    {
        cin >> arr[i];
    }
    sort(arr.begin(), arr.end());
    reverse(arr.begin(), arr.end());
    int count = 0;
    int i = n;
    while (n--) count += arr[i];
    return count;
}
